package com.stylefeng.guns.modular.fileManage.warpper;

import com.stylefeng.guns.common.persistence.model.ZyRecycle;
import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;

import java.util.List;
import java.util.Map;

/**
 * 回收站的包装类
 *
 * @author fengshuonan
 * @date 2017年2月13日 下午10:47:03
 */
public class RecycleWarpper extends BaseControllerWarpper {

    public RecycleWarpper(List<ZyRecycle> list) {
        super(list);
    }

    private final String SYS_USER = "sys_user";

    private final String ZY_TEA = "zy_tea";

    private final String ZY_BREWS = "zy_brews";


    @Override
    public void warpTheMap(Map<String, Object> map) {
        //表名包装
        map.put("modularName", getModularName((String) map.get("tableName")));
        //字段名包装
    }

    /**
     *  根据表名得到模块名称
     * @param
     * @return
     */
    private String getModularName(String tableName){
        if(SYS_USER.equals(tableName)){
            return "用户信息";
        }else if(ZY_TEA.equals(tableName)){
            return "茶叶信息";
        }else if(ZY_BREWS.equals(tableName)){
            return "冲泡方式信息";
        }else{
            return tableName;
        }
    }


}
